package com.ruoyi.storage.fitting.service.impl;

import java.util.List;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import com.ruoyi.storage.fitting.mapper.FittingMapper;
import com.ruoyi.storage.fitting.domain.Fitting;
import com.ruoyi.storage.fitting.service.IFittingService;

/**
 * 配件配置Service业务层处理
 * 
 * @author zzx
 * @date 2024-05-10
 */
@Service
@RequiredArgsConstructor
public class FittingServiceImpl implements IFittingService 
{
    private final FittingMapper fittingMapper;

    /**
     * 查询配件配置
     * 
     * @param fittingId 配件配置主键
     * @return 配件配置
     */
    @Override
    public Fitting selectFittingByFittingId(Long fittingId)
    {
        return fittingMapper.selectFittingByFittingId(fittingId);
    }

    /**
     * 查询配件配置列表
     * 
     * @param fitting 配件配置
     * @return 配件配置
     */
    @Override
    public List<Fitting> selectFittingList(Fitting fitting)
    {
        return fittingMapper.selectFittingList(fitting);
    }

    /**
     * 新增配件配置
     * 
     * @param fitting 配件配置
     * @return 结果
     */
    @Override
    public int insertFitting(Fitting fitting)
    {
        return fittingMapper.insertFitting(fitting);
    }

    /**
     * 修改配件配置
     * 
     * @param fitting 配件配置
     * @return 结果
     */
    @Override
    public int updateFitting(Fitting fitting)
    {
        return fittingMapper.updateFitting(fitting);
    }

    /**
     * 批量删除配件配置
     * 
     * @param fittingIds 需要删除的配件配置主键
     * @return 结果
     */
    @Override
    public int deleteFittingByFittingIds(Long[] fittingIds)
    {
        return fittingMapper.deleteFittingByFittingIds(fittingIds);
    }

    /**
     * 删除配件配置信息
     * 
     * @param fittingId 配件配置主键
     * @return 结果
     */
    @Override
    public int deleteFittingByFittingId(Long fittingId)
    {
        return fittingMapper.deleteFittingByFittingId(fittingId);
    }

    @Override
    public List<Fitting> selectFittingListByFittingName(String keyWord) {
        return fittingMapper.selectFittingListByNameAndFabienName(keyWord);
    }
}
